#!/usr/bin/env python

from ChessBoard import *
import time

#plays a game of chess, which it reads from a file.

chessboard = ChessBoard()
chessboard.resetBoard()

moves = []
with open('moves.txt') as f:

    print "Loading moves..."
    for line in f:
        moves.extend((line.rstrip()).split(" "))

print "Moves loaded"


for i, move in enumerate(moves):
    print "Move number: ", i
    chessboard.printBoard()
    chessboard.addTextMove(move)
    time.sleep(0.2)

''' Print final board '''
chessboard.printBoard()
